# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dhcdrop
pkgver=0.5
pkgrel=3
pkgdesc='Remove illegal dhcp servers with IP-pool underflow.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-networking')
url='http://www.netpatch.ru/dhcdrop.html'
license=('GPL')
depends=('libpcap')
source=("http://www.netpatch.ru/projects/$pkgname/$pkgname-$pkgver.tar.bz2")
sha512sums=('11ac0ca6dcb65f696936e47e43cfbdd59083b607b26b5d12274cc04577be257dda94e9c27eb0c4aebb40f5f572693478cceb04cc4b5b06bf8882c3001fc46142')
groups=('blackarch' 'blackarch-misc')

build() {
  cd "$pkgname-$pkgver"

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr
  else
    ./configure --build=arm --prefix=/usr
  fi

  make
}

package(){
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -aR "src/$pkgname" "$pkgdir/usr/share/$pkgname/"

  ln -s "/usr/share/$pkgname/$pkgname" "$pkgdir/usr/bin/"
}

